<template>
  <div id="app">
    <ul>
      <li class="text-center" v-for="item in links" @click=$goRoute(item.route)>{{item.text}}</li>
    </ul>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  data (){
    return {
      links:[
        {
          text:"一号",
          route:"/home"
        },
        {
          text:"二号",
          route:"/page1"
        },
        {
          text:"三号",
          route:"/page2"
        }
      ]
    }
  }
}
</script>

<style>
.text-center{text-align: center}
ul li {
    display: inline-block;
    margin-right: 10px;
    padding:15px;
    border:1px solid #000;
  }
  ul li a{
    display: inherit;
    padding: 5px 10px;
    border: 1px solid #ccc;
  }
  ul li a:hover{
    cursor: pointer;
    color: #fff;
    background-color: #138bec;
    border: 1px solid #138bec;
  }
</style>
